// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui' // 引入element-ui
import 'element-ui/lib/theme-chalk/index.css'
import eventBus from  './eventBus';
Vue.prototype.$eventBus = eventBus;
// Vue.prototype.$eventBus = new Vue()
import Viewer from 'v-viewer'  //引入图片查看插件
import 'viewerjs/dist/viewer.css'
import CKEditor from '@ckeditor/ckeditor5-vue';

Vue.use( CKEditor );

import './assets/common.css' // 引入公共样式
import common from './common/common' // 公共方法
Vue.prototype.$bus = new Vue()
import request from "./utils/request"
import axios from 'axios'
Vue.prototype.axios = axios // 使用axios
Vue.prototype.$axios = request // 使用新axios

Vue.use(ElementUI) // 使用elementUI

Vue.use(Viewer); //使用图片查看
Viewer.setDefaults({
    'inline': false,
    'button': true, //右上角按钮
    "navbar": false, //底部缩略图
    "title": true, //当前图片标题
    "toolbar": true, //底部工具栏
    "tooltip": true, //显示缩放百分比
    "movable": true, //是否可以移动
    "zoomable": true, //是否可以缩放
    "rotatable": true, //是否可旋转
    "scalable": true, //是否可翻转
    "transition": true, //使用 CSS3 过度
    "fullscreen": true, //播放时是否全屏
    "keyboard": true, //是否支持键盘
    "url": "data-source",
    "loop":false,//禁用循环查看

});

Vue.config.productionTip = false

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router,
    components: { App },
    template: '<App/>'
})

document.onkeyup = (e) => {
    var key = e.keyCode || e.which || e.charCode;   
    if(key == 13 || key == 108) {
        let node = document.getElementById('monitorEnter')
        if(node){
            node.click()
        }
    }
}
